{==============================================================================}
{  Acro Multi-Language Replace Class-Method for IntraWeb                       }
{                                                                              }
{  Copyright (C), 1999-2009, Acroprise Inc.                                    }
{  http://www.acroprise.com.tw                                                 }
{  ALL RIGHTS RESERVED                                                         }
{                                                                              }
{  Author   : Mustapha.Wang                                                    }
{  Version  : 4.0.8.2148                                                       }
{  Creation : 2002/05/06                                                       }
{  Revision :                                                                  }
{  BBS      : http://multilanguage.tech.topzj.com/                             }
{  Task     :                                                                  }
{==============================================================================}
unit IntraWebClassMethod;

interface
uses
  Classes,Graphics,AcroMultiClassMethod;

implementation

uses
  IWControl,IWCompButton,IWDBGrids,IWCompCalendar,IWCompLabel,IWCompCheckBox;

procedure Proc_TIWLabel(ATable:IDataLocate;AComponent:TObject;ALCID,ASeqNo:string;AParams:TStringList);
begin
  TIWLabel(AComponent).Caption:=GetDisplayValue(ATable,TIWLabel(AComponent).Caption,ALCID,ASeqNo,AParams);
end;

procedure Proc_TIWCalendar(ATable:IDataLocate;AComponent:TObject;ALCID,ASeqNo:string;AParams:TStringList);
begin
  TIWCalendar(AComponent).Caption:=GetDisplayValue(ATable,TIWCalendar(AComponent).Caption,ALCID,ASeqNo,AParams);
  TIWCalendar(AComponent).CaptionNext:=GetDisplayValue(ATable,TIWCalendar(AComponent).CaptionNext,ALCID,ASeqNo,AParams);
  TIWCalendar(AComponent).CaptionPrevious:=GetDisplayValue(ATable,TIWCalendar(AComponent).CaptionPrevious,ALCID,ASeqNo,AParams);
  TIWCalendar(AComponent).CaptionToday:=GetDisplayValue(ATable,TIWCalendar(AComponent).CaptionToday,ALCID,ASeqNo,AParams);
end;

procedure Proc_TIWButton(ATable:IDataLocate;AComponent:TObject;ALCID,ASeqNo:string;AParams:TStringList);
begin
  TIWButton(AComponent).Caption:=GetDisplayValue(ATable,TIWButton(AComponent).Caption,ALCID,ASeqNo,AParams);
end;

procedure Proc_TIWCheckBox(ATable:IDataLocate;AComponent:TObject;ALCID,ASeqNo:string;AParams:TStringList);
begin
  TIWCheckBox(AComponent).Caption:=GetDisplayValue(ATable,TIWCheckBox(AComponent).Caption,ALCID,ASeqNo,AParams);
end;

procedure Proc_TIWDBGrid(ATable:IDataLocate;AComponent:TObject;ALCID,ASeqNo:string;AParams:TStringList);
var
  i:integer;
begin
  for i := 0 to TIWDBGrid(AComponent).Columns.Count - 1 do
    TIWDBGridColumn(TIWDBGrid(AComponent).Columns.Items[i]).Title.Text:=
      GetDisplayValue(ATable,TIWDBGridColumn(TIWDBGrid(AComponent).Columns.Items[i]).Title.Text,ALCID,ASeqNo,AParams);
end;

initialization
  AcroMultiClassMethod.AcroClassMethodStorage.RegisterClassMethod(TIWLabel,   Proc_TIWLabel);
  AcroMultiClassMethod.AcroClassMethodStorage.RegisterClassMethod(TIWButton,  Proc_TIWButton);
  AcroMultiClassMethod.AcroClassMethodStorage.RegisterClassMethod(TIWCalendar,Proc_TIWCalendar);
  AcroMultiClassMethod.AcroClassMethodStorage.RegisterClassMethod(TIWDBGrid,  Proc_TIWDBGrid);
  AcroMultiClassMethod.AcroClassMethodStorage.RegisterClassMethod(TIWCheckBox,Proc_TIWCheckBox);
finalization
  AcroMultiClassMethod.AcroClassMethodStorage.UnRegisterClassMethod(TIWLabel);
  AcroMultiClassMethod.AcroClassMethodStorage.UnRegisterClassMethod(TIWButton);
  AcroMultiClassMethod.AcroClassMethodStorage.UnRegisterClassMethod(TIWCalendar);
  AcroMultiClassMethod.AcroClassMethodStorage.UnRegisterClassMethod(TIWDBGrid);
  AcroMultiClassMethod.AcroClassMethodStorage.UnRegisterClassMethod(TIWCheckBox);
end.
